package inits

import (
	"fmt"
	"log"
	"takeout-grpc/basic/config"

	"github.com/spf13/viper"
)

func InitConfig() {
	viper.SetConfigFile("../../config.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		log.Println("读取配置文件失败")
	}
	err = viper.Unmarshal(&config.Config)
	if err != nil {
		log.Println("解析配置文件失败")
	}
	fmt.Println(&config.Config)
}
